﻿using huaxin_DAO;
using huaxin_Interface;
using huaxin_Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace huaxin_Impl
{
    public class huaxin_PayOrderImpl : huaxin_IPayOrder
    {
        private readonly huaxin_PayOrderDao _payOrderDao = new huaxin_PayOrderDao();

        public PayOrder GetByOrderId(string orderId)
        {
            return _payOrderDao.GetByOrderId(orderId);
        }


        /// <summary>
        /// 添加订单信息
        /// </summary>
        /// <param name="order"></param>
        /// <returns></returns>
        public int AddOrder(huaxin_order order)
        {
            return _payOrderDao.AddOrder(order);
        }


        /// <summary>
        /// 订单回调处理
        /// </summary>
        /// <param name="orderNo"></param>
        /// <param name="transactionId"></param>
        /// <returns></returns>
        public int OrderNotifyPay(string orderNo,string transactionId)
        {
            return _payOrderDao.OrderNotifyPay(orderNo, transactionId);
        }


        /// <summary>
        /// 根据订单号获取订单信息
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        public huaxin_order GetOrderIdByInfo(string orderId)
        {
            return _payOrderDao.GetOrderIdByInfo(orderId);
        }

    }
}
